package app;

import java.util.ArrayList;

/********************************************************
 *
 *  Project :  TeamProject
 *  Package :  app
 *  File    :  MealBundle.java
 *  Name    :  Tyler Daines
 *  Date    :  Nov 3, 2013
 *
 ********************************************************/
public class MealBundle
{
	private int ID;
	private String name;
	private ArrayList<Recipe> recipes;
	
	//constructors
	//default constructor for new MealBundle to be added to the database
	public MealBundle(String mbName, ArrayList<Recipe> mbRecipes)
	{
		ID = 0;
		name = mbName;
		recipes = mbRecipes;		
	}
	
	//constructor for MealBundles pulled from the database
	public MealBundle(int mbID, String mbName,ArrayList<Recipe> mbRecipes)
	{
		ID = mbID;
		name = mbName;
		recipes = mbRecipes;
	}

	//getters and setters
	public int getID() 
	{
		return ID;
	}

	public void setID(int iD)
	{
		ID = iD;
	}

	public String getName() 
	{
		return name;
	}

	public void setName(String name) 
	{
		this.name = name;
	}

	public ArrayList<Recipe> getRecipes() 
	{
		return recipes;
	}

	public void setRecipes(ArrayList<Recipe> recipes) 
	{
		this.recipes = recipes;
	}

	@Override
	public String toString()
	{
		StringBuilder bundle = new StringBuilder();
		
		bundle.append(this.name);
		for (Recipe recipe : recipes)
		{
			bundle.append(String.format("\n %s", recipe.toString()));
		}
		return bundle.toString();
	}	
}